# Contributor: Keith Toh <ktprograms@gmail.com>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-sphinx-argparse
pkgver=0.4.0
pkgrel=3
pkgdesc="Sphinx extension that automatically documents argparse commands and options"
url="https://sphinx-argparse.readthedocs.io/en/latest/"
arch="noarch"
license="MIT"
depends="python3 py3-sphinx"
makedepends="py3-gpep517 py3-installer py3-poetry-core py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="sphinx-argparse-$pkgver.tar.gz::https://github.com/ashb/sphinx-argparse/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/sphinx-argparse-$pkgver"

build() {
	gpep517 build-wheel \
		--output-fd 3 3>&1 >&2 \
		--wheel-dir .dist
}

check() {
	pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/sphinx_argparse-$pkgver-py3-none-any.whl
	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
be08ca4eed2786f28dc2288024250577bc767fa9c596946202dc882653ee2d4f3f23230827f802b262c2a4889e6c8b85d01dceb5c494759e6551c8b471d1631f  sphinx-argparse-0.4.0.tar.gz
"
